package cn.icybear.orzjisp;

import java.io.FileInputStream;
import java.io.IOException;

import cn.icybear.orzjisp.orzvm.OrzLoader;
import cn.icybear.orzjisp.orzvm.OrzLoaderException;
import cn.icybear.orzjisp.orzvm.OrzVM;
import cn.icybear.orzjisp.orzvm.OrzVMException;

public class OrzJISP {
	public static void main(String[] args) throws IOException, OrzLoaderException, OrzVMException {
		if (args.length == 0) {
			System.out.println("Usage: OrzJISP orzfile");
			return;
		}
		OrzLoader l = new OrzLoader();
		FileInputStream fis = new FileInputStream(args[0]);
		l.load(fis);
		fis.close();
		OrzVM vm = new OrzVM();
		vm.execute(l);
	}
}
